package com.thrd.taiexhibition.presener;

import com.thrd.taiexhibition.bean.BeanCityInvestDay;
import com.thrd.taiexhibition.callback.MvpCallback;
import com.thrd.taiexhibition.model.CityInvestmentEnvironmentModel;
import com.thrd.taiexhibition.view.CityInvestmentEnvironmentView;

import java.util.List;

/**
 * @author: ${唐杰}
 * @date: 2021/3/25
 */
public class CityInvestmentEnvironmentPresener {
    private CityInvestmentEnvironmentModel mCityInvestmentEnvironmentModel;
    private CityInvestmentEnvironmentView mCityInvestmentEnvironmentView;

    public CityInvestmentEnvironmentPresener(CityInvestmentEnvironmentView mCityInvestmentEnvironmentView){
        this.mCityInvestmentEnvironmentView=mCityInvestmentEnvironmentView;
        this.mCityInvestmentEnvironmentModel=new CityInvestmentEnvironmentModel();
    }

    public void getCityInvestmentEnvironmentData(long cityId){
        mCityInvestmentEnvironmentModel.getCityInvestmentEnvironmentData(cityId, new MvpCallback<List<BeanCityInvestDay>>() {
            @Override
            public void onSuccess(List<BeanCityInvestDay> beanHotActivityList) {
                mCityInvestmentEnvironmentView.onSuccess(beanHotActivityList);
            }

            @Override
            public void onFailed(String e, int code) {
                mCityInvestmentEnvironmentView.onError(e,code);
            }
        });
    }
}
